/*
 * @Description:
 * @Author: admin
 * @Date: 2021-06-08 17:36:30
 * @LastEditors: admin
 * @LastEditTime: 2021-06-08 17:36:30
 */
function Person (name, age) {
  this.name = name;
  this.age = age;
  this.friends = [];
}
Person.prototype = {
  constructor: Person,
  sayName: function () {
    console.log(this.name)
  }
}
var p1 = new Person('larry', 22);
p1.friends.push('任老师')
var p2 = new Person('terry', 19);
p2.friends.push('张老师');
console.log(p1);
console.log(p2);